package com.hunt.controller;

import com.hunt.model.entity.StockFlow;
import com.hunt.model.entity.StockFlowNew;
import com.hunt.service.StockFlowService;
import com.hunt.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * @Author sjs
 * @Date 2020/8/27/ 9:30
 * @Description
 */

@Api(value = "手机app端,基金持股明细模块")
@Controller
@RequestMapping(path = "/app/stockFlow")
public class StockFlowController extends BaseController {

    @Autowired
    private StockFlowService stockFlowService;

    @ApiOperation(value = "查找股票代码", httpMethod = "GET", produces = "application/json", response = Result.class)
    @ResponseBody
    @RequestMapping(value = "findByStockCode", method = RequestMethod.GET)
    public Result findStockCode(@RequestParam("stockCode") String stockCode) {
        StockFlow  stockFlow = stockFlowService.findByStockCode(stockCode);
        return Result.success(stockFlow);
    }
    @ApiOperation(value = "查找股票代码新", httpMethod = "GET", produces = "application/json", response = Result.class)
    @ResponseBody
    @RequestMapping(value = "findByStockCodeNew", method = RequestMethod.GET)
    public Result findStockCodeNew(@RequestParam("stockCode") String stockCode) {
        StockFlowNew stockFlow = stockFlowService.findByStockCodeNew(stockCode);
        return Result.success(stockFlow);
    }
}
